package chp10.score;

public class ScoreCalc {

    int chinese;

    int english;

    int math;

    //展示总成绩
    public void showTotal(){
        int sum = chinese + english + math;
        System.out.println("总成绩:" + sum);
    }

    //展示平均成绩
    public void showAvg(){
        int sum = chinese + english + math;
        int avg = sum / 3;
        System.out.println("平均成绩:" + avg);
    }


    /**
     * 获取总成绩
     * @return 返回总和
     */
    public int getTotal(){
        int sum = chinese + english + math;
        return sum;
    }


    /**
     * 获取平均成绩
     * @return 返回平均值
     */
    public int getAvg(){
        int sum = chinese + english + math;
        int avg = sum / 3;
        return avg;
    }

    /**
     *
     * @param a 语文成绩
     * @param b 数学成绩
     * @param c 英语成绩
     * @return 总和
     */
    public int getTotal(int a,int b,int c){
        int sum = a + b + c;
        return sum;
    }

    /**
     *
     * @param a 语文成绩
     * @param b 数学成绩
     * @param c 英语成绩
     * @return 平均分
     */
    public int getAvg(int a,int b,int c){
        int sum = a + b + c;
        int avg = sum / 3;
        return avg;
    }
}
